Skip to content

test: migrate stats/base/dists/pareto-type1/logpdf to ULP-based assertions - #14842

Merged
kgryte merged 1 commit into
developfrom
philipp/ulp-pareto-type1-logpdf
Aug 31, 2026
Merged

test: migrate stats/base/dists/pareto-type1/logpdf to ULP-based assertions#14842
kgryte merged 1 commit into
developfrom
philipp/ulp-pareto-type1-logpdf

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • Migrates the tests for @stdlib/stats/base/dists/pareto-type1/logpdf from relative-tolerance testing to ULP (units in the last place) difference testing, per the tracking issue.
  • Replaces the delta/tol (EPS-based) comparisons in test/test.logpdf.js, test/test.native.js, and test/test.factory.js with t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ).
  • The minimum ULP bound (1) was determined by measuring the actual ULP difference between the computed and expected values across all three fixture sets (large_alpha, large_beta, both_large); the measured maximum ULP difference was 0 (exact matches) for the JavaScript, factory, and native implementations, so 1 is used as the tightest bound with a minimal safety margin. Verified deterministic across two full test runs, including the native addon (built locally for verification).
  • No other tests, behavior, or files were changed.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code, which selected the candidate package, studied prior-art conversions referenced in #11352, applied the isAlmostSameValue migration, and measured the minimum ULP bound against the fixtures.


@stdlib-js/reviewers


Generated by Claude Code

@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Good First PR A pull request resolving a Good First Issue. labels Aug 31, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/pareto-type1/logpdf $\\color{green}339/339$
$\\color{green}+100.00\\%$
$\\color{green}25/25$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}339/339$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 31, 2026
@kgryte
kgryte marked this pull request as ready for review August 31, 2026 23:29
@kgryte
kgryte requested a review from a team August 31, 2026 23:29
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 31, 2026
@kgryte
kgryte merged commit a303009 into develop Aug 31, 2026
82 checks passed
@kgryte
kgryte deleted the philipp/ulp-pareto-type1-logpdf branch August 31, 2026 23:30
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Statistics Issue or pull request related to statistical functionality. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants